<?php
/**
 * Created by PhpStorm.
 * User: dingjinlai
 * Date: 2019/2/23
 * Time: 下午2:24
 */

class Excel {


    public function ReadCsv($uploadfile='')
    {
        $data = array();
        $file = fopen($uploadfile, "r");
        while (!feof($file)) {
            $data[] = fgetcsv($file);
        }


       // $data = eval('return ' . iconv('gbk', 'utf-8', var_export($data, true)) . ';');

        foreach ($data as $key => $value) {
            if (!$value) {
                unset($data[$key]);
            }
        }
        fclose($file);
        return $data;
    }
}